package org.br.erp.rfq.xbj.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Select;
import org.br.erp.rfq.xbj.entity.Scmxjditem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.br.erp.rfq.xbj.vo.ScmXjdItemVo;

/**
 * @Description: 询价单分录
 * @Author: jeecg-boot
 * @Date:   2023-09-16
 * @Version: V1.0
 */
public interface ScmxjditemMapper extends BaseMapper<Scmxjditem> {

	/**
	 * 通过主表id删除子表数据
	 *
	 * @param mainId 主表id
	 * @return boolean
	 */
	public boolean deleteByMainId(@Param("mainId") String mainId);

  /**
   * 通过主表id查询子表数据
   *
   * @param mainId 主表id
   * @return List<Scmxjditem>
   */
	public List<Scmxjditem> selectByMainId(@Param("mainId") String mainId);


	@Select("select item.id as itemid,head.id as headid,head.fullcityname ,item.matcode ,item.count as matcount,item.matname ,item.remarks ,item.quality,head.vin,head.plate,head.accidentimages,head.licenseimage,head.vehicle,head.billcode  from scmxjditem item\n" +
			"inner join scmxjd head on item.parentid =head.id \n" +
			"  ${ew.customSqlSegment} ")
	public List<ScmXjdItemVo> getXjdItemList(@Param("page") IPage<ScmXjdItemVo> page, @Param(Constants.WRAPPER) QueryWrapper<ScmXjdItemVo> queryWrapper);
}
